  <?php 
  $repository=BO::getProductBORepository();
  $id=getFormValue('id');
  $productBO = $repository->getProductBO($id);	?>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">Product : <?php echo $productBO->getName() ?></div>
  <div class="panel-body">
		<p>
		
		</p>	

	  	
		<ul class="nav nav-tabs" role="tablist">
		  <li><a href="dispatch.php?target=product-edit&id=<?php echo $productBO->getID() ?>">General</a></li>
		  <li><a href="dispatch.php?target=product_attribute-edit&id=<?php echo $productBO->getID() ?>">Attributes</a></li>
		  <li><a href="dispatch.php?target=product_images-edit&id=<?php echo $productBO->getID() ?>">Images</a></li>
		  <li><a href="dispatch.php?target=product_pricing-edit&id=<?php echo $productBO->getID() ?>">Pricing</a></li>
		  <li><a href="dispatch.php?target=product_categories-edit&id=<?php echo $productBO->getID() ?>">Categories</a></li>
		  <li class="active"><a href="dispatch.php?target=product_variations-edit&id=<?php echo $productBO->getID() ?>">Variations</a></li>
		</ul>
		<div class="panel">	
			<div class="panel-body">
				<div class="bs-example">
					<h1>Product :Add Variations</h1>
					<form class="form-horizontal" action="dispatch.php" method="post">
						<input type="hidden" name="target" value="product_variations-add">
						<input type="hidden" name="id" value="<?php echo $productBO->getID() ?>">
						<div class="form-group">
							<label class="control-label col-xs-2" for="inputEmail">Variation Color:</label>
							<div class="col-xs-2">
								<input type="input" name="color" value="" class="form-control" id="inputName" placeholder="Color">
							</div>
							<label class="control-label col-xs-2" for="inputEmail">Variation Size:</label>
							<div class="col-xs-2">
								<input type="input" name="size" value="" class="form-control" id="inputName" placeholder="Size">
							</div>
							<div class="col-xs-4">
								<input type="submit" class="btn btn-primary" value="Submit">
							</div>
						</div>
					</form>
				</div>
				
				<div class="bs-example">
					<h1>Category : Product List</h1>
						<div class="table-responsive">
							<table class="table table-striped">
							  <thead>
								<tr>
								  <th>Name</th>
								  <th>SKU</th>
								  <th>Color</th>
								  <th>Size</th>
								  <th>Price</th>
								  <th>Action</th>
								</tr>
							  </thead>
							  <tbody>
								<tr>
								  <td><?php echo $productBO->getName();?></td>
								  <td><?php echo $productBO->getSKU();?></td>
								  <td><?php echo $productBO->getColor();?></td>
								  <td><?php echo $productBO->getSize();?></td>
								  <td><?php echo $productBO->getPrice();?></td>
								  <td>
									&nbsp;Master Product
								  </td>	
								</tr>
								<?php 
									$productBOs =$productBO->getVariationBOs(); 					
									foreach($productBOs as $productBO)
									{
								?>
								<tr>
								  <td><?php echo $productBO->getName();?></td>
								  <td><?php echo $productBO->getSKU();?></td>
								  <td><?php echo $productBO->getColor();?></td>
								  <td><?php echo $productBO->getSize();?></td>
								  <td><?php echo $productBO->getPrice();?></td>
								  <td>
									<div class="btn-group">
									 <a href="dispatch.php?target=product-edit&id=<?php echo $productBO->getID()?>"  class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
									  <a href="dispatch.php?target=product-delete&id=<?php echo $productBO->getID()?>"  class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></a>
									  <div class="btn-group">
										<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
										  More 
										  <span class="caret"></span>
										</button>
										<ul class="dropdown-menu" role="menu">
										   <?php if($productBO->isOnline()) {?>
											  <li><a href="dispatch.php?target=product-offline&id=<?php echo $productBO->getID();?>">offline</a></li>
											  <?php } else {?>
											  <li><a href="dispatch.php?target=product-online&id=<?php echo $productBO->getID();?>">online</a></li>
											  <?php } ?>
										 
										  <li><a href="#">copy</a></li>
										</ul>
									  </div>
									</div>
								  </td>	
								</tr>
								<?php	
									}
								?>
							  </tbody>
							</table>
					</div>
				</div>
		</div>
		
	</div>
	
	 <div class="panel-footer">
		<div class="btn-group">
			<form action="dispatch.php" method="post">
				<button type="submit" name="target" value="product-add" class="btn btn-default btn-lg">
					<span class="glyphicon glyphicon-plus"></span> New Product
				</button>
			</form>
		</div>
	</div>	
</div>	
		  
		  
		  
